package greedy.onClass.class1.exer04;

import java.util.PriorityQueue;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        PriorityQueue<String> pQueue = new PriorityQueue<>((e1, e2) -> (e2 + e1).compareTo(e1 + e2));
        for (int i = 0; i < n; i++) {
            pQueue.offer(sc.next());
        }
        StringBuilder sBuilder = new StringBuilder();
        while (!pQueue.isEmpty()) {
            sBuilder.append(pQueue.poll());
        }
        String prevRetStr = sBuilder.toString();
        int curIndex = 0;
        while (curIndex < prevRetStr.length() - 1 && prevRetStr.charAt(curIndex) == '0') {
            curIndex++;
        }
        System.out.println(prevRetStr.substring(curIndex));
        sc.close();
    }
}
